package com.java.basis.collection.set;

import java.util.TreeSet;

/**
 * @author wangning
 * @create 2021-04-22 22:24
 */
public class TestTreeSet02 {
	public static void main(String[] args) {
		//1.创建集合
		TreeSet<Person> people = new TreeSet<>();
		//2.添加元素
		Person person = new Person("xyz",20);
		Person person1 = new Person("hello",22);
		Person person2 = new Person("zhangsan",25);
		Person person3 = new Person("zhangsan",20);

		people.add(person);
		people.add(person1);
		people.add(person2);
		people.add(person3);
		System.out.println(people.toString());

		//3.删除
//		people.remove(person);
		//4.遍历

	}
}
